/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package etherblocks.mods.shooter.entitysystem.systems;

import etherblocks.game.entitysystem.*;
import etherblocks.mods.shooter.entitysystem.components.*;

/**
 *
 * @author Carl
 */
public class ShotEffectSystem implements EntitySystem{

    @Override
    public void onNextFrameCalculation(EntityMap entityMap, float lastTimePerFrame){
        for(Entity entity : entityMap.getEntities(HealthComponent.class, ShotComponent.class)){
            int newHealth = (entity.getComponent(HealthComponent.class).getHealth() - 1);
            entity.setComponent(new HealthComponent(newHealth));
            entity.clearComponent(ShotComponent.class);
        }
    }
}
